<?php

/**
 * video form base class.
 *
 * @method video getObject() Returns the current form's model object
 *
 * @package    preuvideo
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasevideoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                => new sfWidgetFormInputHidden(),
      'tema_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Tema'), 'add_empty' => false)),
      'youtube_id'        => new sfWidgetFormInputText(),
      'titulo'            => new sfWidgetFormInputText(),
      'descripcion'       => new sfWidgetFormTextarea(),
      'puntaje'           => new sfWidgetFormInputText(),
      'cantidad_de_votos' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'                => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'tema_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Tema'))),
      'youtube_id'        => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'titulo'            => new sfValidatorString(array('max_length' => 255)),
      'descripcion'       => new sfValidatorString(array('max_length' => 1000)),
      'puntaje'           => new sfValidatorInteger(),
      'cantidad_de_votos' => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('video[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'video';
  }

}
